{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pipelining: chaining a PCA and a logistic regression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Adapted from http://scikit-learn.org/stable/auto_examples/plot_digits_pipe.html"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The PCA does an unsupervised dimensionality reduction, while the logistic regression does the prediction.\n",
    "\n",
    "We use a GridSearchCV to set the dimensionality of the PCA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "using ScikitLearn, PyPlot\n",
    "using ScikitLearn.GridSearch: GridSearchCV\n",
    "using ScikitLearn.Pipelines: Pipeline, named_steps\n",
    "\n",
    "@sk_import decomposition: PCA\n",
    "@sk_import datasets: load_digits\n",
    "@sk_import linear_model: LogisticRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAEWCAYAAABPON1ZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAIABJREFUeJzs3XdUFNfbB/Dv7IIsXaqCCgpIRCwodiUqFrCAJkYUg1hQeTUGJcZorLFjLBhiglh+lhixd2OJijFRDBGwIKJipQkiSFE69/1j3IVlF1hmF3ZX7+ecObN7587sA+LDcOcWhhBCQFEURaksnrIDoCiKompGEzVFUZSKo4maoihKxdFETVEUpeJooqYoilJxNFFTFEWpOJqoKYqiVBxN1BRFUSpOQ9kBqLrMzEycP38eLVu2hLa2trLDoSjqA1JQUIBnz57Bzc0Npqam1dajiboW58+fh4+Pj7LDoCjqA7Z37158+eWX1R6niboWLVu2BAAMHrwXa9Y4KDcYGQUGBiI4OFjZYdSJusVM461/6hYzl3jv378PHx8fUZ6pDk3UtRA2dzx96oDOnTsrORrZGBoaqk2sQuoWM423/qlbzPLEW1uz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8y22NnZwc7OzusWbMGOTk5cHd3R1JSEqKjo5/L85Mno6kP8kIwMjKCp6cnvvnmG6XpCzmO4+Dj44N9+/bh2rVrfL2iogLff/89f3rc87R3716Ul5fz9/Py8pCbmws/Pz8A/86POzo6IjU1VWG6oKCgAAcOHMCUKVM6/JyBgYHgOA7r169Xuf3OnTsd3qdYLAYA3Lt3T6FeW1uLlpYWhZqdnR04jkNDQ0OHn4d0Dh1RkxdGQkICPDw84OTkhHfffRdWVla4evUqMjMzkZ+fDwDYuHEjDh06hNGjR2PJkiVQU1NDcnIyGhsb8fnnnyvs73lMZQwcOBBjxozB4sWL+dPzjI2NsXLlSn5MXFwc/Pz84ObmhgULFqC+vh7btm2DVCpFVFRUh5/T2toaGzduxJo1a3D16lUEBARAV1cXV65cwd69e7Fo0SIsX768Q/u0sbFB7969kZSUBIlEArFYDFdXV5w9exbh4eEIDg6Gra0tmpubkZaWBnV1dQQFBXU4O+kcatTkheHg4ICcnBx8+umnSEpKwqNHj2BhYYGQkBB+zLBhw3D8+HFERkYiNjYWra2tcHNzw3fffQdnZ2eF/T3t435bqsaHhoaC4zhs3boVlZWVcHV1RWJiIvr06cOPGT9+PLKyshAVFYWoqChoaGjA29sbsbGxCmendMSqVaswePBgbNmyhZ9+MDc3h6+vL/z9/Z+au21dXV0daWlpiIyMxOLFi9Hc3Ixdu3bBy8sLvr6+yMjIgEwmg46ODkaMGIGsrCy4uLh0KjvpOBHryW9yCHlBlZWVwcrKCvHx8R0+eiWko2iOmhBCBI6mPkiPq6mpeeqPKR6fSiDkVUONmvS4pUuXIjU1td3tIpFI6cwDIRCJRB2e5yakM2iOmvS4wsJChVPcVBk3blw3pSFEeKhRE0KIwNGXiYQQInDUqAkhROCoURNCiMBRoyaEEIGjRk0IIQJHjZoQQgSOGjUhhAjc/wBTUE5lncpo/QAAAABJRU5ErkJggg==",
      "text/plain": [
       "PyPlot.Figure(PyObject <matplotlib.figure.Figure object at 0x31a539ed0>)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "PyObject <matplotlib.legend.Legend object at 0x31eedacd0>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Original Python Code source: Gaël Varoquaux\n",
    "# License: BSD 3 clause\n",
    "\n",
    "logistic = LogisticRegression(max_iter=200)\n",
    "\n",
    "pca = PCA()\n",
    "pipe = Pipeline([(\"pca\", pca), (\"logistic\", logistic)])\n",
    "\n",
    "digits = load_digits()\n",
    "X_digits = digits[\"data\"]\n",
    "y_digits = digits[\"target\"]\n",
    "\n",
    "###############################################################################\n",
    "# Plot the PCA spectrum\n",
    "fit!(pca, X_digits)\n",
    "\n",
    "figure(1, figsize=(4, 3))\n",
    "clf()\n",
    "PyPlot.axes([.2, .2, .7, .7])\n",
    "plot(pca.explained_variance_, linewidth=2)\n",
    "axis(\"tight\")\n",
    "xlabel(\"n_components\")\n",
    "ylabel(\"explained_variance_\")\n",
    "\n",
    "###############################################################################\n",
    "# Prediction\n",
    "\n",
    "n_components = [20, 40, 64]\n",
    "Cs = 10 .^ range(-4; stop=4, length=3)\n",
    "\n",
    "#Parameters of pipelines can be set using ‘__’ separated parameter names:\n",
    "estimator = GridSearchCV(pipe,\n",
    "                         Dict(\"pca__n_components\"=>n_components,\n",
    "                              \"logistic__C\"=>Cs))\n",
    "fit!(estimator, X_digits, y_digits)\n",
    "\n",
    "axvline(named_steps(estimator.best_estimator_)[\"pca\"].n_components,\n",
    "            linestyle=\":\", label=\"n_components chosen\")\n",
    "legend(prop=Dict(\"size\"=>12))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 0.7.0",
   "language": "julia",
   "name": "julia-0.7"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "0.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
